﻿var toggleBg = function(img, bg) {
    var imgbg = img.length > 3 ? img : bg;
    var style = "<style type=\"text/css\">";
    style += "BODY{background-color: transparent;margin: 0;padding: 0;";
    style += " background: url(" + imgbg + ") left top;";
    style += "}";
    style += "</style>";
    document.write(style);
}